﻿//------------------------------------------------------------
// shaco Framework
// Copyright © 2017-2021 chang.liu All rights reserved.
// Feedback: 449612236@qq.com
//------------------------------------------------------------

namespace shaco.Base
{
    /// <summary>
    /// 游戏类管理中心
    /// </summary>
    [System.Diagnostics.DebuggerStepThrough]
    public abstract class GameHelper : IGameHelper
    {
        /// <summary>
        /// 打印日志类
        /// </summary>
        [GameInterfaceTypeAtrribute("Log", "DEBUG")]
        static public shaco.Base.ILog log
        {
            get { if (null == _log) _log = GetOrSetDefaultInterface<shaco.Base.ILog, shaco.Base.Log>(); return _log; }
            set { BindInterface<shaco.Base.ILog>(value); _log = value; }
        }
        static private shaco.Base.ILog _log = null;

        /// <summary>
        /// c#事件，便于添加、删除、派发事件，具有穿透性和易管理性
        /// </summary>
        [GameInterfaceTypeAtrribute("Event Manager", "C#")]
        static public shaco.Base.IEventManager Event
        {
            get { if (null == _Event) _Event = GetOrSetDefaultInterface<shaco.Base.IEventManager, shaco.Base.EventManager>(); return _Event; }
            set { BindInterface<shaco.Base.IEventManager>(value); _Event = value; }
        }
        static private shaco.Base.IEventManager _Event = null;

        /// <summary>
        /// 便捷的数据储存管理，支持自动加密和解密功能
        /// UnityEngine.PlayerPrefs更好的替代方案
        /// </summary>
        [GameInterfaceTypeAtrribute("Data Save", "C#")]
        static public shaco.Base.IDataSave datasave
        {
            get { if (null == _datasave) _datasave = GetOrSetDefaultInterface<shaco.Base.IDataSave, shaco.Base.DataSave>(); return _datasave; }
            set { BindInterface<shaco.Base.IDataSave>(value); _datasave = value; }
        }
        static private shaco.Base.IDataSave _datasave = null;

        /// <summary>
        /// c#内存池
        /// </summary>
        [GameInterfaceTypeAtrribute("Object Pool", "C# Pool")]
        static public shaco.Base.IObjectPool objectpool
        {
            get { if (null == _objectpool) _objectpool = GetOrSetDefaultInterface<shaco.Base.IObjectPool, shaco.Base.ObjectPool>(); return _objectpool; }
            set { BindInterface<shaco.Base.IObjectPool>(value); _objectpool = value; }
        }
        static private shaco.Base.IObjectPool _objectpool = null;

        /// <summary>
        /// c#内存池对象生成器
        /// </summary>
        [GameInterfaceTypeAtrribute("Object Pool Spwan", "C# Pool")]
        static public shaco.Base.IObjectSpawn objectpoolSpawn
        {
            get { if (null == _objectpoolSpawn) _objectpoolSpawn = GetOrSetDefaultInterface<shaco.Base.IObjectSpawn, shaco.Base.ObjectSpwan>(); return _objectpoolSpawn; }
            set { BindInterface<shaco.Base.IObjectSpawn>(value); _objectpoolSpawn = value; }
        }
        static private shaco.Base.IObjectSpawn _objectpoolSpawn = null;

        /// <summary>
        /// http网络类单例，用于上传和下载http请求数据
        /// </summary>
        [GameInterfaceTypeAtrribute("Http Helper", "C# Net")]
        static public shaco.Base.IHttpHelper http
        {
            get { if (null == _http) _http = GetOrSetDefaultInterface<shaco.Base.IHttpHelper, shaco.Base.HttpHelper>(); return _http; }
            set { BindInterface<shaco.Base.IHttpHelper>(value); _http = value; }
        }
        static private shaco.Base.IHttpHelper _http = null;

        /// <summary>
        /// 新手引导通用类
        /// </summary>
        [GameInterfaceTypeAtrribute("Guide Manager", "C# Guide")]
        static public shaco.Base.IGuideManager newguide
        {
            get { if (null == _newguide) _newguide = GetOrSetDefaultInterface<shaco.Base.IGuideManager, shaco.Base.GuideManager>(); return _newguide; }
            set { BindInterface<shaco.Base.IGuideManager>(value); _newguide = value; }
        }
        static private shaco.Base.IGuideManager _newguide = null;

        /// <summary>
        /// 引导数据配置帮助类
        /// </summary>
        [GameInterfaceTypeAtrribute("Guide Setting Helper", "C# Guide")]
        static public shaco.Base.IGuideSettingHelper guideSettingHelper
        {
            get { if (null == _guideSettingHelper) _guideSettingHelper = GetOrSetDefaultInterface<shaco.Base.IGuideSettingHelper, shaco.Base.GuideSettingHelper>(); return _guideSettingHelper; }
            set { BindInterface<shaco.Base.IGuideSettingHelper>(value); _guideSettingHelper = value; }
        }
        static private shaco.Base.IGuideSettingHelper _guideSettingHelper = null;

        /// <summary>
        /// 数据配置帮助类
        /// </summary>
        [GameInterfaceTypeAtrribute("Setting Helper", "C#")]
        static public shaco.Base.ISettingHelper settinghelper
        {
            get { if (null == _settinghelper) _settinghelper = GetOrSetDefaultInterface<shaco.Base.ISettingHelper, shaco.Base.SettingHelper>(); return _settinghelper; }
            set { BindInterface<shaco.Base.ISettingHelper>(value); _settinghelper = value; }
        }
        static private shaco.Base.ISettingHelper _settinghelper = null;

        /// <summary>
        /// zip格式压缩解压
        /// </summary>
        [GameInterfaceTypeAtrribute("Zip Helper", "C#")]
        static public shaco.Base.IZipHelper zip
        {
            get { if (null == _zip) _zip = GetOrSetDefaultInterface<shaco.Base.IZipHelper, shaco.Base.ZipHelper>(); return _zip; }
            set { BindInterface<shaco.Base.IZipHelper>(value); _zip = value; }
        }
        static private shaco.Base.IZipHelper _zip = null;

        /// <summary>
        /// 模拟平台事件类
        /// </summary>
        [GameInterfaceTypeAtrribute("Simulate Platfrom Event", "C#")]
        static public shaco.Base.ISimulatePlatformEvent simulatePlatformEvent
        {
            get { if (null == _simulatePlatformEvent) _simulatePlatformEvent = GetOrSetDefaultInterface<shaco.Base.ISimulatePlatformEvent, shaco.Base.SimulatePlatformEventDefault>(); return _simulatePlatformEvent; }
            set { BindInterface<shaco.Base.ISimulatePlatformEvent>(value); _simulatePlatformEvent = value; }
        }
        static private shaco.Base.ISimulatePlatformEvent _simulatePlatformEvent = null;

        /// <summary>
        /// 数据类型与字符串相关转换类
        /// </summary>
        [GameInterfaceTypeAtrribute("Data Type Template", "C# Config")]
        static public shaco.Base.IDataTypesTemplate dateTypesTemplate
        {
            get { if (null == _dateTypesTemplate) _dateTypesTemplate = GetOrSetDefaultInterface<shaco.Base.IDataTypesTemplate, shaco.Base.DataTypesTemplate>(); return _dateTypesTemplate; }
            set { BindInterface<shaco.Base.IDataTypesTemplate>(value); _dateTypesTemplate = value; }
        }
        static private shaco.Base.IDataTypesTemplate _dateTypesTemplate = null;

        /// <summary>
        /// 本地化语言类
        /// </summary>
        [GameInterfaceTypeAtrribute("Localization", "C#")]
        static public shaco.Base.ILocalization localization
        {
            get { if (null == _localization) _localization = GetOrSetDefaultInterface<shaco.Base.ILocalization, shaco.Base.Localization>(); return _localization; }
            set { BindInterface<shaco.Base.ILocalization>(value); _localization = value; }
        }
        static private shaco.Base.ILocalization _localization = null;

        /// <summary>
        /// excel附加参数配置类
        /// </summary>
        [GameInterfaceTypeAtrribute("Excel Setting", "C# Config")]
        static public shaco.Base.IExcelSetting excelSetting
        {
            get { if (null == _excelSetting) _excelSetting = GetOrSetDefaultInterface<shaco.Base.IExcelSetting, shaco.Base.ExcelDataSetting>(); return _excelSetting; }
            set { BindInterface<shaco.Base.IExcelSetting>(value); _excelSetting = value; }
        }
        static private shaco.Base.IExcelSetting _excelSetting = null;

        /// <summary>
        /// 性能分析类
        /// </summary>
        [GameInterfaceTypeAtrribute("Profiler", "DEBUG")]
        static public shaco.Base.IProfiler profiler
        {
            get { if (null == _profiler) _profiler = GetOrSetDefaultInterface<shaco.Base.IProfiler, shaco.Base.Profiler>(); return _profiler; }
            set { BindInterface<shaco.Base.IProfiler>(value); _profiler = value; }
        }
        static private shaco.Base.IProfiler _profiler = null;

        /// <summary>
        /// 观察者模式管理类
        [GameInterfaceTypeAtrribute("Observer", "C#")]
        static public shaco.Base.IObserverManager observer
        {
            get { if (null == _observer) _observer = GetOrSetDefaultInterface<shaco.Base.IObserverManager, shaco.Base.ObserverManager>(); return _observer; }
            set { BindInterface<shaco.Base.IObserverManager>(value); _observer = value; }
        }
        static private shaco.Base.IObserverManager _observer = null;

        /// <summary>
        /// 音效管理类
        /// </summary>
        [GameInterfaceTypeAtrribute("Sound", "C# Audio")]
        static public shaco.Base.ISoundManager sound
        {
            get { if (null == _sound) _sound = GetOrSetDefaultInterface<shaco.Base.ISoundManager, shaco.Base.AudioManager>(); return _sound; }
            set { BindInterface<shaco.Base.IAudioManager>(value); _sound = value; }
        }
        static private shaco.Base.ISoundManager _sound = null;

        /// <summary>
        /// 音乐管理类
        /// </summary>
        [GameInterfaceTypeAtrribute("Music", "C# Audio")]
        static public shaco.Base.IMusicManager music
        {
            get { if (null == _music) _music = GetOrSetDefaultInterface<shaco.Base.IMusicManager, shaco.Base.AudioManager>(); return _music; }
            set { BindInterface<shaco.Base.IMusicManager>(value); _music = value; }
        }
        static private shaco.Base.IMusicManager _music = null;

        /// <summary>
        /// 人物声音管理类
        /// </summary>
        [GameInterfaceTypeAtrribute("Voice", "C# Audio")]
        static public shaco.Base.IVoiceManager voice
        {
            get { if (null == _voice) _voice = GetOrSetDefaultInterface<shaco.Base.IVoiceManager, shaco.Base.AudioManager>(); return _voice; }
            set { BindInterface<shaco.Base.IVoiceManager>(value); _voice = value; }
        }
        static private shaco.Base.IVoiceManager _voice = null;

        /// <summary>
        /// 网络套接字管理类
        /// </summary>
        [GameInterfaceTypeAtrribute("SocketHelper", "C# Net")]
        static public shaco.Base.Net.ISocketHelper socketHelper
        {
            get { if (null == _socketHelper) _socketHelper = GetOrSetDefaultInterface<shaco.Base.Net.ISocketHelper, shaco.Base.Net.SocketHelperTCP>(); return _socketHelper; }
            set { BindInterface<shaco.Base.Net.ISocketHelper>(value); _socketHelper = value; }
        }
        static private shaco.Base.Net.ISocketHelper _socketHelper = null;

        /// <summary>
        /// 网络客户端类
        /// </summary>
        [GameInterfaceTypeAtrribute("NetClient", "C# Net")]
        static public shaco.Base.Net.IClient netClient
        {
            get { if (null == _netClient) _netClient = GetOrSetDefaultInterface<shaco.Base.Net.IClient, shaco.Base.Net.ClientTCP>(); return _netClient; }
            set { BindInterface<shaco.Base.Net.IClient>(value); _netClient = value; }
        }
        static private shaco.Base.Net.IClient _netClient = null;

        /// <summary>
        /// DEBUG堆栈类
        /// </summary>
        [GameInterfaceTypeAtrribute("StackLocation", "DEBUG")]
        static public shaco.Base.IStackLocationConfig stacklocationConfig
        {
            get { if (null == _stacklocation) _stacklocation = GetOrSetDefaultInterface<shaco.Base.IStackLocationConfig, shaco.Base.StackLocationConfig>(); return _stacklocation; }
            set { BindInterface<shaco.Base.IStackLocationConfig>(value); _stacklocation = value; }
        }
        static private shaco.Base.IStackLocationConfig _stacklocation = null;

        /// <summary>
        /// 协程类
        /// </summary>
        [GameInterfaceTypeAtrribute("Coroutine", "C#")]
        static public shaco.Base.ICoroutineHelper coroutine
        {
            get { if (null == _coroutine) _coroutine = GetOrSetDefaultInterface<shaco.Base.ICoroutineHelper, shaco.Base.CoroutineHelper>(); return _coroutine; }
            set { BindInterface<shaco.Base.ICoroutineHelper>(value); _coroutine = value; }
        }
        static private shaco.Base.ICoroutineHelper _coroutine = null;
    }
}